import QtQuick 2.0
import Qt.labs.folderlistmodel 2.1
Rectangle {
    id: root

    signal clicked(string fileBaseName, string fileSuffix)
    property string folder
    property var nameFilters: []

    FListView {
        anchors.fill: parent
        model: FolderListModel {
            id: listModel
            folder: root.folder// fx.path.toUrl(fx.path.path + "/program")
            nameFilters: root.nameFilters//["*.qxiu"]
        }

        onClicked: {
            root.clicked(listModel.get(index, "fileBaseName"), listModel.get(index, "fileSuffix"))
        }
        component: Item{
            Text {
                text: modelData.fileBaseName
                anchors.centerIn: parent
            }
        }
    }
}

